package com.zzyl.mapper;

import com.zzyl.dto.BedDto;
import com.zzyl.entity.Bed;
import com.zzyl.vo.BedVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface BedMapper {

    List<BedVo> getBedsByRoomId(Long roomId);

    void addBed(Bed bed);

    void updateBed(Bed bed);

    @Select("select * from bed where id=#{id}")
    Bed getBedById(Long id);

    @Delete("delete from bed where id=#{id}")
    void deleteBedById(Long id);

    @Select("select * from bed where bed_number=#{bedNumber} and room_id=#{roomId}")
    Bed getBedByBedNumber(String bedNumber, Long roomId);


}

